import type { SearchList } from "@/types/form";
import type { TableColumn } from "@/types/public";
import { MENU_MODULE } from "@/utils/constants";

// 搜索数据
export const searchList = (): SearchList[] => [
    {
        label: "日期",
        name: "username",
        component: "RangePicker",
        componentProps: {
            allowClear: true,
        },
    },
    {
        label: "模块",
        name: "module",
        wrapperWidth: 230,
        component: "Select",
        componentProps: {
            options: MENU_MODULE(),
        },
    },
    {
        label: "操作",
        name: "option",
        wrapperWidth: 230,
        component: "Select",
        componentProps: {
            options: MENU_MODULE(),
        },
    },
];

/**
 * 表格数据
 * @param optionRender - 渲染操作函数
 */
export const tableColumns = (): TableColumn[] => {
    return [
        {
            title: "编号",
            dataIndex: "id",
            width: 100,
        },
        {
            title: "模块",
            dataIndex: "username",
            width: 150,
        },
        {
            title: "方法",
            dataIndex: "title",
            width: 150,
        },
        {
            title: "用户id",
            dataIndex: "content",
            width: 150,
        },
        {
            title: "用户姓名",
            dataIndex: "content",
            width: 150,
        },
        {
            title: "信息",
            dataIndex: "content",
            width: 150,
        },
        {
            title: "ip地址",
            dataIndex: "content",
            width: 150,
        },
        {
            title: "添加时间",
            dataIndex: "content",
            width: 150,
        },
    ];
};
